import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import tui from './common/tui.js' // 普通的快速工具类
import api from './common/api/api.js' //api 接口
import utils from './utils/util.js'
import uView from '@/uni_modules/vk-uview-ui';
import Bridge from '@/common/dsbridge.js'  //多端数据传输
import { createPinia } from 'pinia'
// import { useMainStore } from '@/store/index.js'

export function createApp() {
  const app = createSSRApp(App)
  const pinia = createPinia()
  app.config.globalProperties.tui = tui
  app.config.globalProperties.api = api
  app.config.globalProperties.utils = utils
  app.config.globalProperties.$bridge = Bridge
  // app.config.globalProperties.$store = useMainStore()
  app.use(uView);
  app.use(pinia); 
  return {
    app,
	pinia
  }
}
// #endif